package com.ibeeking.found.open.api.feign;


import com.ibeeking.found.open.api.common.param.OpenAuthModifyTenantIdParam;
import com.ibeeking.found.open.api.common.param.OpenAuthParam;
import com.ibeeking.found.open.api.common.param.OpenAuthCancelParam;
import com.ibeeking.found.open.api.feign.fallback.GlobalOpenAuthFeignFallbackFactory;
import com.ibeeking.nematos.utils.result.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author ibeeking
 */
@FeignClient(name = "gmc-global-g-server", path = "/g", contextId = "globalOpenAuthFeignClient", fallbackFactory = GlobalOpenAuthFeignFallbackFactory.class, decode404 = true)
public interface GlobalOpenAuthFeignClient {

    /**
     * 更新授权
     *
     * @param param
     * @return
     */
    @PostMapping("/openAuth/feign/v1/modifyAuth")
    ResponseResult<Boolean> modifyAuth(@RequestBody OpenAuthParam param);

    /**
     * 取消授权
     *
     * @param param
     * @return
     */
    @PostMapping("/openAuth/feign/v1/cancelAuth")
    ResponseResult<Boolean> cancelAuth(@RequestBody OpenAuthCancelParam param);

    /**
     * 更新授权租户id
     * @param param
     * @return
     */
    @PostMapping("/openAuth/feign/v1/modifyAuthTenantId")
    ResponseResult<Boolean> modifyAuthTenantId(@RequestBody OpenAuthModifyTenantIdParam param);

}
